package com.qb.common.base

import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import com.qb.baselibrary.basekotlin.BaseActivity
import com.qb.baselibrary.basekotlin.BaseViewModel
import com.qb.common.R

/**
 * @ClassName: CommonBaseActivity
 * @Description: Description
 * @Author: Huimin
 * @Date: 2022/9/19 19:04
 */
abstract class CommonBaseActivity<VM : BaseViewModel,DB: ViewBinding> :BaseActivity<VM,DB>() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        // Hide the status bar
//        window.setFlags(
//            WindowManager.LayoutParams.FLAG_FULLSCREEN,
//            WindowManager.LayoutParams.FLAG_FULLSCREEN);
//
//        // Optionally, you can also hide the action bar if you are using one
//        if (supportActionBar != null) {
//            supportActionBar?.hide();
//        }
        // Change the status bar color
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            val window = window
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
            window.statusBarColor = ContextCompat.getColor(this, R.color.white)
        }
    }
}